
Technical Q&A's
QD3D 84 - Checking For QD3D Windows DLLs (11-July-97)
Q
Is there any QuickDraw 3D "gestalt" equivalent on the Windows side which will tell you if QD3D
is present?
A
There is no exact equivalent to gestalt on Windows. It's not really necessary because the
entire system is just based on shared libraries (DLLs).
The simplest way to check for the presence of QD3D is to try and load the QD3D
library.
#if defined (DEBUG)
hinst = LoadLibrary( "QD3D_D.DLL" );
#else
hinst = LoadLibrary( "QD3D.DLL" );
#endif
if ( hinst != NULL )
{
Q3GetVersion( &major, &minor );
// Use it...
}
else
{
// QuickDraw 3D not present
// handle that...
}
Additionally the QD3D DLLs all have version resources which can be queried using
the Win32 version control API without loading the library.
The QD3D installer registers several keys in the registry which could also be used
to determine if QD3D was installed. Note: Apple requires that Independent Software Vendors
install QD3D using the QD3D installer or its equivalent. Just copying the DLLs is not
sufficient. These include HKLM\SOFTWARE\Apple Computer Inc\QuickDraw 3D\...
Note there is no equivalent to "weak linking" on Windows. An application which links against
QD3D will fail to load if QD3D is not present. An application which is
concerned that QD3D might not be present will have to dynamically load and link
against QD3D using the LoadLibrary
and GetProcAddress
routines
or related functions.
However, keep in mind that one of the most common reasons that Mac OS applications do not link
against QD3D is because they wish to keep their memory image small. This is really
not an issue on Windows due to the way virtual memory and the loader work in that environment.
On Windows, a more accurate metric of runtime memory usage is working set.
QD3D should have only a minimal impact on working set if it is not fully initialized
(via Q3Initialize) or used.
Note the QD3D Viewer can be used without explicit linking against the 3DViewer.DLL.
See the Windows SDK sample "ViewerSampleWin32Only".
-- Scott Kuechle
devsupport@apple.com
Technical Support
Technical Q&As
Previous Question | Contents

Main |
Page One |
What's New |
Apple Computer, Inc. |
Find It |
Contact Us |
Help